﻿/* ***************************************************************************
 *  This file is part of the C# port of the Invivo AI challenge simulation environment.
 *  Copyright 2010 Colin Green
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program .  If not, see <http://www.gnu.org/licenses/>.
 * 
 * 
 * This file incorporates open sourced work authored by the following people:
 *
 *   Copyright (c) 2009 Simon Funk
 */
namespace FunkAIChallenge
{
    /// <summary>
    /// Abstract class for controllers.
    /// A PlayerController contains logic for controlling a player via a PlayerInterface 
    /// provided at construction time.
    /// </summary>
    public abstract class PlayerController
    {
        /// <summary>
        /// The player interface to be used for controlling the player.
        /// </summary>
        protected PlayerInterface _iface;

        /// <summary>
        /// Construct with the provided player interface.
        /// </summary>
        public PlayerController(PlayerInterface iface)
        {
            _iface = iface;
        }

        /// <summary>
        /// Perform one controller step. Typically consisting of reading world and player arm state
        /// from the player interface and updating the torques applied at each player arm joint.
        /// </summary>
        public abstract void Step();
    }
}
